﻿@namespace BlazorFluentUI
@inherits FluentUIComponentBase

<LocalCS @bind-Rules="@ProgressIndicatorLocalRules" />

<div class=@($"mediumFont ms-ProgressIndicator{(Indeterminate ? " is-indeterminate" : "")} {ClassName}") style=@Style>
    @if (!string.IsNullOrWhiteSpace(Label))
    {
        <div class="ms-ProgressIndicator-itemName">@Label</div>
    }
    @if (!ProgressHidden)
    {
        @if (RenderProgressTemplate != null)
        {
            @RenderProgressTemplate(PercentComplete)
        }
        else
        {
            <div class="@ProgressIndicatorItemProgressRule.Selector?.SelectorName" >
                <div class="ms-ProgressIndicator-progressTrack @ProgressIndicatorProgressTrackRule.Selector?.SelectorName" />
                <div class="ms-ProgressIndicator-progressBar @ProgressIndicatorProgressBarRule.Selector?.SelectorName"
                     style=@(Indeterminate ? "" : GetWidthByPercentage())
                     role="progressbar"
                     aria-valuemin=@AriaValueMin
                     aria-valuemax=@AriaValueMax
                     aria-valuenow=@AriaValueNow
                     aria-valuetext=@AriaValueText />
            </div>
        }
    }
    @if (!string.IsNullOrWhiteSpace(Description))
    {
        <div class="ms-ProgressIndicator-itemDescription">@Description</div>
    }
</div>
